﻿<phone:PhoneApplicationPage
    x:Class="Vanglen.JBJLQ.Detail"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:local="clr-namespace:Vanglen.JBJLQ"
     FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True" local:TiltEffect.IsTiltEnabled="True" Loaded="PhoneApplicationPage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="加班记录器" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="加班明细" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <TextBlock Text="选择月份" Margin="0,20" />
                <toolkit:DatePicker Name="tbDate" ValueChanged="tbDate_ValueChanged"/>
            </StackPanel>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>
            </Grid.RowDefinitions>

            <ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Foreground="Silver" Width="120" Margin="20,0,0,0">日期</TextBlock>
                        <TextBlock Foreground="Silver" Width="100" Margin="10,0,0,0">开始时间</TextBlock>
                        <TextBlock Foreground="Silver" Width="100" Margin="10,0,0,0">结束时间</TextBlock>
                        <TextBlock Foreground="Silver" Width="100" Margin="10,0,0,0">原因</TextBlock>
                        <TextBlock Foreground="Silver" Width="200" Margin="10,0,0,0">备注</TextBlock>
                    </StackPanel>
                    <ListBox x:Name="lbDetail"  
                         ScrollViewer.HorizontalScrollBarVisibility="Visible" 
                         FontSize="{StaticResource PhoneFontSizeLarge}" 
                         ItemsSource="{Binding}" 
                         Tap="ListBox_Tap">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>

                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,10,0,10">
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="10" Text="{Binding id}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="120" Text="{Binding date}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="100" Text="{Binding timebegin}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="100" Text="{Binding timeend}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="100" Text="{Binding reason}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    <TextBlock TextWrapping="Wrap" Margin="5,0,5,0" Width="200" Text="{Binding note}" Style="{StaticResource PhoneTextTitle3Style}" />

                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="删除" Click="DelItem_Click"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </StackPanel>

                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </ScrollViewer>

            <StackPanel Grid.Row="1">
                <TextBlock Name="tbTotal" Text=""></TextBlock>
            </StackPanel>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>